import axios from 'axios'
import jsonp from '../assets/js/jsonp'
import {
  commonParams,
  options
} from './config'
// axios.defaults.withCredentials = true
export function getRecommend() {
  const url = "http://124.71.183.213:3000/banner"
  return axios.get(url)

}
export function getDiscList() {
  const url = "/api/recommend/playlist/u"
  return axios.get(url)
}

// export async function getSongList(id) {
//   const url = "/api/songlist"
//   return await axios.request({
//     url,
//     method: 'get',
//     params: {
//       'id': id
//     }
//   })
// }
// axios.defaults.headers.common['referer'] = 'https://y.qq.com/'
// axios.defaults.headers.common['origin'] = 'https://y.qq.com/'

export async function getSongList(disstid) {
  const url = '/qqapi?id=2429907335'

  const data = Object.assign({}, commonParams, {
    disstid,
    type: 1,
    json: 1,
    utf8: 1,
    onlysong: 0,
    platform: 'yqq',
    hostUin: 0,
    needNewCode: 0,
    g_tk_new_20200303: 1872031642,
    g_tk: 1872031642,
    notice: 0,
    needNewCode: 0
  })

  return await axios.request({
    url,
    data,
    method: 'get',

  })
}